import React, { Component } from "react";

class A extends Component {
    state = {
        name : '陶贼帅'
    }
    render() {
        return (
            <div>
                <h1>this is A component</h1>
                <B render={ ( name )=> <C name={name}></C> }  name={ this.state.name }/>
                
            </div>
        );
    }
}

class B extends Component {
    render() {
        return (
            <div>
                <h2>this is B component</h2>
                { this.props.render( this.props.name ) }
            </div>
        );
    }
}

class C extends Component {


    render() {
        return (
            <div>
                <h3>this is C component 接收到参数：{ this.props.name }</h3>
            </div>
        );
    }
}


export default A;
